Skip to content

fix(har): embed content that is not valid UTF-8 as base64 - #43524

Merged
Yury Semikhatsky (yury-s) merged 3 commits into
mainfrom
fix-43493
Oct 19, 2026
Merged

Yury Semikhatsky (yury-s) merged 3 commits into
mainfrom
fix-43493

Conversation

@yury-s

Copy link
Copy Markdown
Member
  • With content: 'embed', a body with a textual mime type was always stored as text, so a binary body served as application/javascript was decoded lossily and replayed with different bytes.
  • Store it as text only when it is valid UTF-8 (isUtf8()), and as base64 otherwise.
  • New HA-113 instead of extending HA-021: it is fixme in WebKit, which decodes the body of a textual resource before Playwright gets it, so the original bytes are already lost there.

Supersedes #43498: the same fallback, checked with isUtf8() instead of re-encoding every textual body. Its HA-113 fails in WebKit for the reason above, and its HA-114 repeats what HA-021 already checks.

Fixes #43493
Closes: #43498

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures.

🟢 All failures are confirmed pre-existing flakes

The three real failures have each failed on unrelated revisions before. This PR at 55bb66a changes only HAR body encoding and its library test, so it does not reach the failing MCP or test-runner paths.

Details

Pre-existing flakes

  • [msedge] › mcp/annotate.spec.ts:417 › should cancel browser_annotate when the MCP client disconnects — failed in 3 of 498 prior runs for the same project and Windows Edge bot, including this run for #43173.
  • [msedge] › mcp/http.spec.ts:132 › http transport browser sigint — failed in 6 of 498 prior runs for the same project and Windows Edge bot, including this run for #43432.
  • [playwright-test] › web-server.spec.ts:121 › should run web server with PLAYWRIGHT_TEST=1 environment variable — the same Windows Server 2025 bot had the same timeout and Expected: 0 / Received: 1 failure on unrelated main revision 0d7c141 in this prior run; it passed the other 165 of 166 prior runs.

Triaged by the Playwright bot - agent run

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

5154 passed, 614 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 failed
❌ [playwright-test] › expect.spec.ts:943 › should support mergeExpects with builtin matcher overrides @playwright-x64-server2025-64-core-node22
❌ [playwright-test] › playwright.reuse.spec.ts:460 › should reset tracing @playwright-x64-server2025-64-core-node22
❌ [playwright-test] › playwright.spec.ts:303 › should respect headless in modifiers that run before tests @playwright-x64-server2025-64-core-node22
❌ [playwright-test] › playwright.unhandled.spec.ts:35 › should produce unhandledRejection when page.route raises @playwright-x64-server2025-64-core-node22
❌ [playwright-test] › reporter-json.spec.ts:360 › should report parallelIndex @playwright-x64-server2025-64-core-node22

3 flaky ⚠️ [playwright-test] › ui-mode-trace.spec.ts:388 › should reveal errors in the sourcetab `@playwright-x64-server2025-64-core-node22`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:193 › CR-011 should intercept service worker requests (main and within) `@chromium-playwright-x64-ubuntu24-64-core-node22`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › VI-030 should work with video+trace `@chromium-playwright-x64-ubuntu24-64-core-node22`

23574 passed, 713 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures.

🟡 Two failures are uncertain; three are confirmed pre-existing flakes

This PR at 938a86d changes only embedded HAR body encoding and its library test, so it does not reach the failing test-runner paths. Three tests have the same failure on unrelated #43405, but the other two have no prior failure in the available history and cannot be called flakes yet.

Details

Overall assessment

The failures do not look caused by this PR. A clean rerun would resolve the two uncertain results; without one, the available history is not enough for a green verdict.

Pre-existing flakes

  • [playwright-test] › playwright.reuse.spec.ts:460 › should reset tracing — timed out with the same Expected: 0 / Received: 1 failure on unrelated #43405. It failed in 2 of 170 recent runs on this Windows runner and passed in 168.
  • [playwright-test] › playwright.spec.ts:303 › should respect headless in modifiers that run before tests — timed out with the same Expected: 0 / Received: 1 failure on unrelated #43405. It failed in 2 of 170 recent runs on this Windows runner and passed in 168.
  • [playwright-test] › playwright.unhandled.spec.ts:35 › should produce unhandledRejection when page.route raises — timed out with the same Expected: 1 / Received: 0 failure on unrelated #43405. It failed in 2 of 170 recent runs on this Windows runner and passed in 168.

Uncertain

  • [playwright-test] › expect.spec.ts:943 › should support mergeExpects with builtin matcher overrides — the nested run timed out, but this is its first failure in 170 recent runs on this Windows runner. The HAR-only diff does not reach it, but there is no unrelated failure that proves it is a flake.
  • [playwright-test] › reporter-json.spec.ts:360 › should report parallelIndex — reported workerIndex 0 instead of 2, but this is its first failure in 170 recent runs on this Windows runner. The PR does not touch reporter or worker allocation code, but there is no unrelated failure that proves it is a flake.

Triaged by the Playwright bot - agent run

@yury-s
Yury Semikhatsky (yury-s) merged commit 0c59897 into main Oct 19, 2026
25 of 26 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the fix-43493 branch October 19, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: recordHar embed stores binary body as lossy text when Content-Type is textual

2 participants